/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.equipment.service;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.persistence.Result;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.equipment.dao.EleEquipmentDao;
import com.thinkgem.jeesite.modules.equipment.entity.EleEquipment;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 设备管理Service
 * @author ZC
 * @version 2017-04-18
 */
@Service
@Transactional(readOnly = true)
public class EleEquipmentService extends CrudService<EleEquipmentDao, EleEquipment> {

	
	public EleEquipment get(String id) {
		EleEquipment eleEquipment = super.get(id);
		return eleEquipment;
	}
	
	public List<EleEquipment> findList(EleEquipment eleEquipment) {
		return super.findList(eleEquipment);
	}
	
	public Page<EleEquipment> findPage(Page<EleEquipment> page, EleEquipment eleEquipment) {
		return super.findPage(page, eleEquipment);
	}
	
	@Transactional(readOnly = false)
	public void save(EleEquipment eleEquipment) {
		super.save(eleEquipment);
	}
	
	@Transactional(readOnly = false)
	public void delete(EleEquipment eleEquipment) {
		super.delete(eleEquipment);
	}

	@Transactional(readOnly = false)
	public Result checkEquipment(EleEquipment eleEquipment){
		int result = dao.check(eleEquipment);
		if(result>0){
			return new Result(Result.SUCCESS, "审核操作成功!", null);
		}else{
			return new Result(Result.FAILURE, "审核操作完成!", null);
		}
	}
}